import App from './App'
import Vue from 'vue'
import store from './store'
import request from './api/request.js'
import upload from './goods/api/upload.js'
// import './uni.promisify.adaptor'

// 测试
// import api from './api'
// Vue.prototype.$api = api

Vue.config.productionTip = false
Vue.prototype.apiGet=request.get;
Vue.prototype.apiPost=request.post;
Vue.prototype.upload=upload.post;
Vue.prototype.$store = store

import uView from "uview-ui";
Vue.use(uView);

// 封装msg方法
const msg = (title,icon='none') => {
	uni.showToast({
		title:title,
		duration:1000,
		mask:true,
		icon
	});
};
// 成功后返回上一页
const msgback=(title,icon='success')=>{
	uni.showToast({
		title:title,
		duration:1000,
		mask:true,
		icon
	});
	setTimeout(()=>{
		uni.navigateBack({
			delta:1
		})
	},1000)
}
Vue.prototype.msg=msg;
Vue.prototype.msgback=msgback;
console.log(process.env.NODE_ENV,7878);
// if (process.env.NODE_ENV === 'production') {
// 	console.log = () => {}
// 	console.warn = () => {}
// 	console.error = () => {}
// }

// if (uni.getSystemInfoSync().platform !== "devtools") {
// console.log = () => {}
// }

App.mpType = 'app'
const app = new Vue({
	store,
  ...App
})
app.$mount()
